package com.tanie.fenxiao.entities;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

@Entity
@Table(name = "article")
//@Table关联表的名称
public class Article extends BaseBean {

	@ManyToOne(cascade = { javax.persistence.CascadeType.PERSIST }, fetch = FetchType.EAGER)
	//多对一关系注解
	@JoinColumn(name = "article_cate")//加入一列为外键
	@NotFound(action = NotFoundAction.IGNORE)//意思是找不到引用的外键数据时忽略，
	private ArticleCate articleCate;//时间
	private String title;//标题
	private String summary;//概要

	@JoinColumn(columnDefinition = "text")//加入一列类型
	private String content;//内容
	private Integer views;//见解
	private Integer status;//状态

	public ArticleCate getArticleCate() {
		return this.articleCate;
	}

	public void setArticleCate(ArticleCate articleCate) {
		this.articleCate = articleCate;
	}

	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getContent() {
		return this.content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public Integer getViews() {
		return this.views;
	}

	public void setViews(Integer views) {
		this.views = views;
	}

	public Integer getStatus() {
		return this.status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public String getSummary() {
		return this.summary;
	}

	public void setSummary(String summary) {
		this.summary = summary;
	}
}
